package dayu.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;
import java.util.List;

/**
 * @author dayu
 * @create 2018/12/13 15:04
 * @Description
 */
@Controller
@RequestMapping("/student")
public class StudentController {
    @RequestMapping("/findAll")
    public String findAll(Model model) {
        Subject subject = SecurityUtils.getSubject();
//        boolean permitted = subject.isPermitted("student.*");
//        if(subject.hasRole("student")){
        List<String> students = Arrays.asList("小明", "王海", "张三丰");
        model.addAttribute("students", students);
        return "student/student";
//        }
//        return "forward:/user/logout";
    }
}
